package com.ruoyi.platform.utils.uuid;

import com.ruoyi.platform.utils.AppUtil;

public class UniqueIdUtil {
    private static IdGenerator idGenerator;

    public UniqueIdUtil() {
    }

    private static void initIdGenerator() {
        idGenerator = (IdGenerator) AppUtil.getBean(IdGenerator.class);
        System.out.println(idGenerator);
    }

    public static Long getUId() {
        return idGenerator.nextId();
    }

    public static String getSuid() {
        return getUId().toString();
    }

    static {
        initIdGenerator();
    }
}
